package com.in.utils;

import android.R.style;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.in.R;
import com.in.insa.actorsetting.ActorSetting;
import com.in.insa.actorsetting.ActorSettingView1;
import com.in.insa.actorsetting.ActorSettingView2;
import com.in.insa.actorsetting.ActorSettingView3;
import com.in.insa.actorsetting.ActorSettingView4;
import com.in.insa.menu.Menu;
import com.in.insa.menu.MenuStore;
 
public class Popup2 extends Activity{

	private String callPage; 
	private String TAG = "Popup2";
	private Intent intent;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
		setContentView(R.layout.popup2);
		
		Button popup2_confirm = (Button)findViewById(R.id.popup2_confirm);   

		String title = getIntent().getStringExtra("title");
		String content= getIntent().getStringExtra("content");
		String imageType = getIntent().getStringExtra("imageType"); 
		
		callPage = getIntent().getStringExtra("callPage");

		intent = new Intent();
		setText(title, content, imageType );
		
		View.OnClickListener listener = new View.OnClickListener() { 
			
			@Override
			public void onClick(View v) {
				switch( v.getId() ) {
				case R.id.popup2_confirm:
					setResult(90, intent);
					
					if("MenuStoreBuySoojung".equals(callPage)){
						Intent i1 = new Intent(Popup2.this, MenuStore.class);
						startActivity(i1);
					}
					
					finish();
					break;
				}
			}
		};
		popup2_confirm.setOnClickListener(listener);
	}

	public void setText(String title, String content, String imageType){
	 	
		TextView popup2_title = (TextView)findViewById(R.id.popup2_title_text);
		TextView popup2_contents = (TextView)findViewById(R.id.popup2_contents);

		popup2_title.setText(title);
		popup2_contents.setText(content);

	}
	
	@Override
	protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
		super.onApplyThemeResource(theme, resid, first);
		theme.applyStyle(style.Theme_Dialog, true);
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
	}
	
}	






	